﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace TinyCinema.UI.Pages
{
    public class TabPage : System.Windows.Controls.Page
    {
        public static DependencyProperty ContentFrameSourceProperty = DependencyProperty.Register("pagContentFrameSource", typeof(Page), typeof(TabPage));
        public Page pagContentFrameSource
        {
            get { return (Page)GetValue(ContentFrameSourceProperty); }
            set { SetValue(ContentFrameSourceProperty, value); }
        }
        public static DependencyProperty TabControlsProperty = DependencyProperty.Register("TabControls", typeof(ItemCollection), typeof(TabPage));
        public ItemCollection TabControls
        {
            get { return GetValue(TabControlsProperty) as ItemCollection; }
            set { SetValue(TabControlsProperty, value); }
        }
        protected Button btnPreTab;
        protected virtual void TabControl(object sender, RoutedEventArgs e)
        {
            var btnSender = sender as Button;            
            try { btnPreTab.IsEnabled = true; }
            catch { }
            btnSender.IsEnabled = false;
            btnPreTab = btnSender;
            IsIniting = false;
        }
        protected bool IsIniting=true;
        protected virtual void TabControl(object sender, EventArgs e)
        {
            TabControl(sender, new RoutedEventArgs());
        }
    }
}
